Những câu hỏi liên quan
Nya arigatou~
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 4 2021 lúc 13:16

const fi='tamgiac.dat'

      fo='tamgiac.out'

var f1,f2:text;

    a,b,c,d,e,f:array[1..100]of integer;

    i,n,dem1,dem2,dem3:integer;

    ab,bc,ac:real;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,n);

for i:=1 to n do

  readln(f1,a[i],b[i],c[i],d[i],e[i],f[i]);

dem1:=0;

dem2:=0;

dem3:=0;

for i:=1 to n do

  begin

     ab:=sqrt(sqr(a[i]-c[i])+sqr(b[i]-d[i]));

     ac:=sqrt(sqr(a[i]-e[i])+sqr(b[i]-f[i]));

     bc:=sqrt(sqr(c[i]-e[i])+sqr(d[i]-f[i]));

     if (ab>0) and (ac>0) and (bc>0) and (ab+ac>bc) and (ab+bc>ac) and

(ac+bc>ab) then

        begin

           if (ab=ac) or (ac=bc) then inc(dem1);

           if ((ab=ac) and (ab<>bc) and (ac<>bc)) then inc(dem2);

           if ((ac=bc) and (bc<>ab) and (ac<>ab)) then inc(dem2);

           if ((ac=bc) and (ac<>ab) and (bc<>ab)) then inc(dem2);

           if sqr(ab)=sqr(ac)+sqr(bc) then inc(dem3);

           if sqr(ac)=sqr(bc)+sqr(ab) then inc(dem3);

           if sqr(bc)=sqr(ab)+sqr(ac) then inc(dem3);

        end;

  end;

writeln(f2,dem1);

writeln(f2,dem2);

writeln(f2,dem3);

close(f1);

close(f2);

end.

Bình luận (0)
Ngọc Diệp
Xem chi tiết
nguyễn an phát
12 tháng 5 2021 lúc 20:24

program du_lieu;

uses crt;

var i,n:integer;

a:array[1..100]of integer;

tbc:real;

f:text;

begin

clrscr;

assign(f,'DULIEU.INP');reset(f);

readln(f,n);

for i:=1 to n do

begin

read(f,a[i]);

end;

close(f);

for i:=1 to n do

tbc:=tbc+a[i];

writeln(tbc/n);

readln;

end.

Bình luận (0)
Đặng Minh quân
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 5 2021 lúc 18:41

uses crt;

const fi='dulieu.inp'

var f1:text;

a:array[1..100]of integer;

n,i,t1,t2:integer;

begin

clrscr;

assign(f1,fi); reset(f1);

readln(f1,n);

for i:=1 to n do 

  read(f1,a[i]);

t1:=0;

t2:=0;

for i:=1 to n do 

 begin

if a[i]>0 then t1:=t1+a[i];

if a[i]<0 then t2:=t2+a[i];

end;

writeln('Tong cac so duong la: ',t1);

writeln('Tong cac so am la: ',t2);

close(f1);

readln;

end.

Bình luận (0)
Nguyễn Nhật Bình
Xem chi tiết
Felix MC-Gamer
Xem chi tiết
Lê Thị Hồng Trang
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 3 2022 lúc 22:46

uses crt;

const fi='so.inp'

var f1:text;

a,b:integer;

begin

clrscr;

assign(f1,fi); reset(f1);

while not eof(f1) do 

 begin

readln(f1,a,b);

writeln((a+b)/2:4:2);

end;

close(f1);

readln;

end.

Bình luận (0)
Yến Chi Phan Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 6:55

uses crt;

const fi='dulieu.dat'

var f1:text;

a,b,p,s:array[1..100]of real;

i,n:integer;

begin

clrscr;

assign(f1,fi); reset(f1);

n:=0;

while not eof(f1) do 

begin

n:=n+1;

readln(a[n],b[n]);

end;

for i:=1 to n do 

  begin

p[i]:=(a[i]+b[i])/2;

s[i]:=a[i]*b[i];

end;

for i:=1 to n do 

  writeln(p[i]:4:2,' ',s[i]:4:2);

close(f1);

readln;

end.

Bình luận (0)
Huy !
Xem chi tiết
Minh Lệ
10 tháng 5 2023 lúc 19:24

Bạn bổ sung thêm đề nha.

Bình luận (0)
Hoàng Thị Minh Tuyết
Xem chi tiết